# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Radim Hvizdák <hvizdakr at gmail dot com>

pkgname=ibus-hangul
pkgver=1.5.4
pkgrel=5
pkgdesc='Korean input engine for IBus'
arch=('loong64' 'x86_64')
url='https://github.com/phuang/ibus-hangul'
license=('GPL')
depends=('ibus' 'libhangul' 'iso-codes' 'gtk-update-icon-cache' 'python-gobject')
makedepends=('intltool' 'gnome-common')
source=("$pkgname-$pkgver.tar.gz::https://github.com/choehwanjin/ibus-hangul/archive/${pkgver}.tar.gz")
sha512sums=('9ee5a3364fdfb1ec0177c797009f9723f1c7c9bb096c24ec2a8b12340e230207df4c7fe490534dea237850822cd307c6971dec56e9767b5a9fcef82278875b01')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  autoreconf --verbose --force --install
  ./configure --prefix=/usr --libexecdir=/usr/lib/ibus
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make NO_INDEX=true DESTDIR="${pkgdir}" install

  # Fix symlink
  ln -sf ../lib/ibus/ibus-setup-hangul "$pkgdir/usr/bin/ibus-setup-hangul"
}
